package com.zh.common.utils.toast

/**
 * @auth zh
 * @time 2021/12/22 - 16:25
 * @desc Toast 统一管理
 */
object ZToastUtils : IToast {

    private var toast: IToast? = null

    internal fun init(toast: IToast) {
        this.toast = toast
    }

    override fun showShort(message: String?, isCenter: Boolean, icon: Int?) {
        toast?.showShort(message, isCenter, icon)
    }

    override fun showLong(message: String?, isCenter: Boolean, icon: Int?) {
        toast?.showLong(message, isCenter, icon)
    }

    override fun cancel() {
        toast?.cancel()
    }
}